package cn.edu.jxau.core.web;

import java.util.HashMap;
import java.util.Map;

/**
 * Desc:
 * ------------------------------------
 * Author:fulei04@meituan.com
 * Date:2017/12/17
 * Time:下午2:42
 */
public class View {

    /**
     * 视图路径
     */
    private String path;

    /**
     * 数据模型
     */
    private Map<String,Object> model;

    public View(String path) {
        this.path = path;
        this.model = new HashMap<>();
    }

    public View(String path,Map<String,Object> model) {
        this.path = path;
        this.model = model;
    }

    public View addModel(String key,Object val) {
        model.put(key,val);
        return this;
    }

    public String getPath() {
        return path;
    }

    public Map<String,Object> getModel() {
        return model;
    }
}
